#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
char s[100100];
char c[100100];
int len;
int nt[100100];
void getnt()
{
	nt[0]=-1;
	int i = 0;
	int t = -1;
	while(i<len)
	{
		if(t==-1||c[i]==c[t])
		{
			i++;
			t++;
			nt[i] = t;
		}
		else t = nt[t];
	}
}
int kmp()
{
	int i,j;
	i = j = 0;
	while(i<len)
	{
		if(j==-1||s[i]==c[j])
		{
			i++;
			j++;
		}
		else j = nt[j];
	}
	return j;
}
int main()
{
	while(scanf("%s",s)!=EOF)
	{
		memset(c,0,sizeof(c));
		len = strlen(s);
		for(int i = 0,k = len-1;i<len;i++,k--)
		{
			c[i]=s[k];
		}
		getnt();
		int ans = kmp();
		for(int i = 0;i<len;i++) printf("%c",s[i]);
		puts(c+ans);
	}
}
